@extends('web.layouts.app')

@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/index.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/ucenter.css')}}">
@endsection

@section('content')
<div class="uc-wrap swrap mt20">
	<div class="uc-side L">
		<div class="uc-nav">
			<ul>
                    @include('web.user_center.menu')
			</ul>
		</div>
	</div>
	<div class="uc-main uc-mainbg R">
		<!--查询表单-->
		<div class="user-time-search ml20">
			<form method="get" action="{{ action('UserCenter\AgentController@businessManager',['menu'=>10]) }}">
				<span class="ml20">起止日期</span>
				<input type="text" name="startTime" value="{{ $query['startTime']}}" class="date-txt Wdate" onclick="WdatePicker();"> -
				<input type="text" name="endTime" value="{{ $query['endTime'] }}" class="date-txt Wdate" onclick="WdatePicker();">

				<select class="select2" style="height:25px;width:100px;" name="status">
					<option value="">全部</option>
					<option value="rush" {{ $query['status'] == 'rush'?'selected=selected':'' }}>正在投资</option>
					<option value="payment" {{ $query['status'] == 'payment'?'selected=selected':'' }}>正在还款</option>
					<option value="late" {{ $query['status'] == 'late'?'selected=selected':'' }}>还款逾期</option>
					<option value="full" {{ $query['status'] == 'full'?'selected=selected':'' }}>项目满标</option>
					<option value="finish" {{ $query['status'] == 'finish'?'selected=selected':'' }}>还款成功</option>
					<option value="fail" {{ $query['status'] == 'fail'?'selected=selected':'' }}>项目流标</option>
				</select>
				<input type="submit" class="btn" value="搜索">
			</form>
		</div>
		<!--资金项展示-->
		<div class="user-rz-fund-items">
			<dl>
				<dt>投资总金额</dt>
				<dd><em>{{ $invest_money??0 }}</em>元</dd>
			</dl>
		<!-- 	<dl>
				<dt>投资人总收益</dt>
				<dd><em>0.00</em>元</dd>
			</dl> -->
			<dl>
				<dt>总推荐费用</dt>
				<dd><em>{{ $referal_fee??0 }}</em>元</dd>
			</dl>
		</div>
		<!--列表-->
		<div class="user-item-list">
			<ul class="data-list yewu-list">
				<li class="th">
					<div class="col-name">交易名称</div>
					<div class="col-investor">投资人</div>
					<div class="col-date">投资日期</div>
					<div class="col-date">成立日期</div>
					<div class="col-date">还款时间</div>
					<div class="col-money">投资金额(元)</div>
					<div class="col-money">推荐费用(元)</div>
					<div class="col-status">投资状态</div>
				</li>
				@forelse( $projects as $project )
				<li>
					<div class="col-name name">
						<a href="/oneProjects/{{$project->id}}">{{ $project->projects_name??'--' }}</a>
					</div>
					<div class="col-investor">{{ $project->user_name??'--' }}</div>
					<div class="col-date">{{ $project->invest_time??'--' }}</div>
					<div class="col-date">{{ $project->interest_at??'--' }}</div>
					<div class="col-date"> {{ ($project->trade_finish_date??$project->trade_repayment_date)??'--'}}</div>
					<div class="col-money">{{ $project->invest_money??'--' }}</div>
					<div class="col-money">{{ $project->referal_fee??'--' }}</div>
					<div class="col-status">{{ $project->name??'--' }}</div>
				</li>
				@empty
                        <li class="no-data">
                            <p>没有找到相关投资记录~</p>
                        </li>
				@endforelse
			</ul>
			<div class="uc-page-box text-right">
				{!! $links !!}
			</div>
		</div>

	</div>
</div>@endsection

@section('scripts')
    <script src="{{ asset('resources/web/js/index.js') }}"></script>
	<script type="text/javascript" src="{{asset('resources/web/plugins/datePicker/WdatePicker.js')}}"></script>
	<script type="text/javascript">
		
	</script>
@endsection